package com.zhangzeqin.code.service.Impl;

import com.zhangzeqin.code.dao.AdminDao;
import com.zhangzeqin.code.dao.Impl.AdminDaoImpl;
import com.zhangzeqin.code.service.AdminService;

import java.sql.SQLException;


public class AdminServiceImpl implements AdminService {
    /**
     * 实例化一个持久层对象
     */
    AdminDao adminDao=new AdminDaoImpl();

    /**
     * 列出用户信息
     */
    @Override
    public Object[][] listUser(){
        return adminDao.listUser();
    }

    /**
     * 添加单词书
     * @param bookName
     * @return boolean结果
     */
    @Override
    public boolean addBook(String bookName,String nature) {
        return adminDao.addBook(bookName,nature);
    }

    /**
     * 管理员登录
     * @param name
     * @param password
     * @return boolean结果
     */
    @Override
    public boolean landing(String name, String password,String table) {
        return adminDao.landing(name,password,table);
    }

    /**
     * 列出所有单词书
     */
    @Override
    public Object[][] listBook(){
        return adminDao.listBook();
    }

    /**
     * 重载,获得所有单词书的属性值 nature
     */
    @Override
    public Object[] nature(){
        return adminDao.nature();
    }

    /**
     * 列出所有某本单词书的单词
     */
    @Override
    public Object[][] listWord(String bookName){
        return adminDao.listWord(bookName);
    }

    @Override
    public Object getNotice() throws SQLException {
        return adminDao.getNotice();
    }

    @Override
    public boolean publishNotice(String notice) {
        return adminDao.publishNotice(notice);
    }
}
